package com.shangxia.order.controller;

import com.shangxia.order.po.DB_Order;
import com.shangxia.order.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author zhouya38158
 * @Package com.example.user.controller
 * @date 2021/11/2 14:46
 */
@Slf4j
@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping("/{id}")
    public DB_Order queryById(@PathVariable("id") Long id,
                              @RequestHeader(value = "Truth", required = false) String truth) {
        System.out.println("truth: " + truth);
        return orderService.queryById(id);
    }

}
